package top.sdwu_top.kbase.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import top.sdwu_top.kbase.common.annocation.CurrentUser;
import top.sdwu_top.kbase.common.model.Wrapper;
import top.sdwu_top.kbase.entity.KbaseAuthUser;
import top.sdwu_top.kbase.entity.KbaseFileVersion;
import top.sdwu_top.kbase.service.IKbaseFileVersionService;
import top.sdwu_top.kbase.vo.KbaseFileVersionVo;

/**
 * <p>
 * 文件版本 前端控制器
 * </p>
 *
 * @author zhipeng.duan@nvr-china.com
 * @since 2020-02-20
 */
@RestController
@RequestMapping("api/file-version")
public class KbaseFileVersionController {

    @Autowired
    IKbaseFileVersionService fileVersionService;

    //todo user can see?
    @PostMapping("page")
    public Wrapper<Page<KbaseFileVersion>> page(@CurrentUser KbaseAuthUser user, @RequestBody KbaseFileVersionVo vo) {
        return Wrapper.ok(fileVersionService.page(vo));
    }

}

